package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.gmc.global.g.rest.service.IShortUrlService;
import com.ibeeking.found.common.entity.ShortUrlDTO;
import com.ibeeking.found.common.entity.ShortUrlQueryFeign;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/g/shortUrl/feign/v1")
public class ShortUrlFeignController {

    @Resource
    private IShortUrlService shortUrlServiceImpl;

    /**
     * 查询短链接页面映射列表
     * @param query
     * @return
     */
    @PostMapping(value = "/queryShortUrlList")
    public List<ShortUrlDTO> queryShortUrlList(@RequestBody ShortUrlQueryFeign query) {
        return this.shortUrlServiceImpl.queryShortUrlList(query);
    }

    /**
     * 查询短链接页面映射
     * @param query
     * @return
     */
    @PostMapping(value = "/queryShortUrlOne")
    public ShortUrlDTO queryShortUrlOne(@RequestBody ShortUrlQueryFeign query){
        return this.shortUrlServiceImpl.queryShortUrlOne(query);
    }
}
